var initOfferTab = function() {
		YEvent.delegate("offerListTable", "click", viewOffer, '.view-offer-link');
		YEvent.delegate("offerListTable", "click", deleteOffer, '.delete-offer-link');
};
	
var viewOffer = function(event) {
	
	// 'this' refers to element that was clicked
	var parentRow = getParentRow(this);
	// Make xhr call get entity details
	var id = parentRow.readAttribute("offerId");
	getTabContent("offer/edit?offerId="+id);
	
};


var createNewOffer = function() {
	goToTab("OFFERS");
	getTabContent("offer/add");
		
};

var returnToOfferList = function() {
	getTabContent("offers");
};

var deleteOffer = function(event){
	
	
	if (confirm("Are you want to delete?")) {
		// 'this' refers to element that was clicked
		var parentRow = getParentRow(this);
		// Make xhr call get entity details
		var id = parentRow.readAttribute("offerId");
		getTabContent("offer/delete?offerId="+id);
	} else {
		return false;
	}
};